import { getRequest, postRequest, deleteRequest, getDownload, putRequest } from '/src/lib/axios';

export const configureApi = {
    getCurrent: () => {
        return getRequest('/config/institutions/getCurrent');
    },
    updateCurrent: (param) => {
        return putRequest('/config/institutions/updateCurrent', param);
    },

    fetchApps: (param) => {
        return getRequest('/apps/category/fetch', param);
    },
    categoryAdd: (param) => {
        return postRequest('/apps/category/add', param);
    },
    categoryUpdate: (param) => {
        return putRequest('/apps/category/update', param);
    },
    categoryget: (id) => {
        return getRequest(`/apps/category/get/${id}`);
    },
    categoryDelete: (id) => {
        return deleteRequest('/apps/category/delete?ids=' + id);
    },


    // 扩展适配api
    fetchExpandattrs: (param) => {
        return getRequest('/config/expandattrs/fetch', param);
    },
    addExpandattrs: (param) => {
        return postRequest('/config/expandattrs/add', param);
    },
    expandattrsget: (id) => {
        return getRequest(`/config/expandattrs/get/${id}`);
    },
    expandattrsUpdate: (param) => {
        return putRequest('/config/expandattrs/update', param);
    },
    // /config/expandattrs/delete?ids=1056979314714607616,
    expandattrsDelete: (id) => {
        return deleteRequest('/config/expandattrs/delete?ids=' + id);
    },

    // 适配器注册api
    fetchAdapters: (param) => {
        return getRequest('/config/adapters/fetch', param);
    },
    addAdapters: (param) => {
        return postRequest('/config/adapters/add', param);
    },
    adaptersget: (id) => {
        return getRequest(`/config/adapters/get/${id}`);
    },
    adaptersUpdate: (param) => {
        return putRequest('/config/adapters/update', param);
    },
    adaptersDelete: (id) => {
        return deleteRequest('/config/adapters/delete?ids=' + id);
    },

    // 同步器管理 api
    fetchSynchronizers: (param) => {
        return getRequest('/config/synchronizers/fetch', param);
    },
    addSynchronizers: (param) => {
        return postRequest('/config/synchronizers/add', param);
    },
    synchronizersGet: (id) => {
        return getRequest(`/config/synchronizers/get/${id}`);
    },
    synchronizersUpdate: (param) => {
        return putRequest('/config/synchronizers/update', param);
    },
    synchronizersDelete: (id) => {
        return deleteRequest('/config/synchronizers/delete?ids=' + id);
    },
    synchroByID: (id) => {
        return deleteRequest('/config/synchronizers/synchr?id=' + id);
    },

    // 岗位管理 api
    getOrgsTree: () => {
        return getRequest('/orgs/tree');
    },
    fetchPosts: (param) => {
        return getRequest('/posts/fetch', param);
    },
    addPosts: (param) => {
        return postRequest('/posts/add', param);
    },
    getPosts: (id) => {
        return getRequest(`/posts/get/${id}`);
    },
    updatePosts: (param) => {
        return putRequest('/posts/update', param);
    },
    deletePosts: (id) => {
        return deleteRequest('/posts/delete?ids=' + id);
    },

    // 账号策略 api
    fetchAccountsstrategy: (param) => {
        return getRequest('/config/accountsstrategy/fetch', param);
    },
    addAccountsstrategy: (param) => {
        return postRequest('/config/accountsstrategy/add', param);
    },
    getAccountsstrategy: (id) => {
        return getRequest(`/config/accountsstrategy/get/${id}`);
    },
    updateAccountsstrategy: (param) => {
        return putRequest('/config/accountsstrategy/update', param);
    },
    deleteAccountsstrategy: (id) => {
        return deleteRequest('/config/accountsstrategy/delete?ids=' + id);
    },

    // 分类下拉
    queryFindList: () => {
        return getRequest('/apps/category/findList');
    },
    // 应用名称 确定 


};
